import { Controller, Get, Post, Body, Patch, Param, Delete,Query,Res } from '@nestjs/common';
import { ImageService } from './image.service';
import { CreateImageDto } from './dto/create-image.dto';
import { UpdateImageDto } from './dto/update-image.dto';
import { CurrentUser } from '../auth/user.decorator';

@Controller('api/image')
export class ImageController {
  constructor(private readonly imageService: ImageService) {}

  @Post()
  create(@Body() createImageDto: CreateImageDto, @CurrentUser() user: any) {
    return this.imageService.create(createImageDto,user);
  }

  @Get()
  findAll(@Res() response: any, @Query() query: any, @CurrentUser() user: any) {
    return this.imageService.findTask(response,query,user);
  }
}
